package com.jdbc.day03.Service.ServiceImpl;

import com.jdbc.day01.dao.EasybuyUserMapper;
import com.jdbc.day02.entitys.EasybuyUser;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.jdbc.day03.Service.EasybuyUserService;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "Userservice")
public class EasybuyUserServiceImpl implements EasybuyUserService{
    @Resource
    private EasybuyUserMapper Usermapper;

    public EasybuyUserMapper getUsermapper() {
        return Usermapper;
    }
    public void setUsermapper(EasybuyUserMapper usermapper) {
        Usermapper = usermapper;
    }


    @Override
    public int deleteByPrimaryKey(Integer id) {
        return Usermapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(EasybuyUser record) {
        int sum=0;
        try{
            sum=Usermapper.insert(record);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sum;
    }

    @Override
    public int insertSelective(EasybuyUser record) {
        int sum=0;
        try{
             sum=Usermapper.insertSelective(record);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sum;
    }
    @Override
    public EasybuyUser selectByPrimaryKey(Integer id,String name) {
       return Usermapper.selectByPrimaryKey(id,name);
    }

    @Override
    public int updateByPrimaryKeySelective(EasybuyUser record) {
        return Usermapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(EasybuyUser record) {
        return Usermapper.updateByPrimaryKey(record);
    }

    @Override
    public EasybuyUser selectBy(int id, String name, int sex) {
        return Usermapper.selectBy(id,name,sex);
    }


}
